#include<bits/stdc++.h>
using namespace std;
void in(int &x)
{
	x=0;int f1=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f1=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	x*=f1;
}
int n,a[2000005],t=0;
bool v[2000005];
int main()
{
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	in(n);
	for(int i=1;i<=n;i++)
	{
		in(a[i]);
	}
	t=n;
	int k=1;
	while(k)
	{
		int last=0;
		k=0;
		for(int i=1;i<=n;i++)
		{
			if(v[i])continue;
			if(a[i]!=a[last])printf("%d ",i),v[i]=true,k=1;
			last=i;
		}
		printf("\n");
	}
	return 0;
}
